﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace RaceScore
{
    public partial class InputBibs : Form
    {
        Main myParent = null;


        public InputBibs(Main myParent)
        {
            InitializeComponent();
            this.myParent = myParent;
        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            List<int> bibs = new List<int>();

            foreach (DataGridViewRow row in dataGridView1.Rows) 
            {
                if (row.Cells[0].Value == null)
                    continue;

                bibs.Add(Int32.Parse(row.Cells[0].Value.ToString()));
            }

            Program.CurrentRace.Bibs = bibs;

            myParent.InputBibsMessage((dataGridView1.Rows.Count-1).ToString() + " bibs inputted");
            Close();
           
        }
    }
}
